package org.common.utils.nacos.entity;

/**
 * nacos配置地址
 * @author zhouzhibing
 * @date 2025/6/14
 */
public class NacosConfigAddress {

    /**
     * nacos地址
     */
    private NacosAddress nacosAddress;

    /**
     * 数据id
     */
    private String dataId;

    /**
     * 分组
     */
    private String group;

    private NacosConfigAddress() {

    }

    public NacosAddress getNacosAddress() {
        return nacosAddress;
    }

    public String getDataId() {
        return dataId;
    }

    public String getGroup() {
        return group;
    }

    @Override
    public String toString() {
        return "NacosConfigAddress{" +
                "nacosAddress=" + nacosAddress +
                ", dataId='" + dataId + '\'' +
                ", group='" + group + '\'' +
                '}';
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public static class Builder {

        private final NacosConfigAddress nacosConfigAddress = new NacosConfigAddress();

        public Builder setNacosAddress(NacosAddress nacosAddress) {
            this.nacosConfigAddress.nacosAddress = nacosAddress;
            return this;
        }

        public Builder setDataId(String dataId) {
            this.nacosConfigAddress.dataId = dataId;
            return this;
        }

        public Builder setGroup(String group) {
            this.nacosConfigAddress.group = group;
            return this;
        }

        public NacosConfigAddress build() {
            return this.nacosConfigAddress;
        }
    }
}
